import oauth2AdminApiConfig from '@/core/oauth2/generated/apiconfig/oauth2AdminApiConfig'
import serverApiMockUtils from '../../utils/serverApiMockUtils'
import mockProdServerUtils from '../../utils/mockUtils'
import { MockMethod } from 'vite-plugin-mock'
import Mock from 'mockjs'
import Oauth2RegisteredClientRestGrantTypeResponse from '@/core/oauth2/generated/types/model/response/Oauth2RegisteredClientRestGrantTypeResponse'

const content: Oauth2RegisteredClientRestGrantTypeResponse[] = []
for (let i = 0; i < 10; i++) {
	content.push({
		id: i.toString(),
		idOfClient: i.toString(),
		callbackUrl: `callbackUrl_oauth2客户端支持的rest授权协议配置_${i.toString()}`,
		restGrantType: `restGrantType_oauth2客户端支持的rest授权协议配置_${i.toString()}`,
		deleteFlag: '0',
		createTime: new Date().getTime().toString(),
		updateTime: new Date().getTime().toString(),
		rowVersion: 1,
	} as Oauth2RegisteredClientRestGrantTypeResponse)
}

const mockList: MockMethod[] = [
	...serverApiMockUtils.getDefaultServerApi(oauth2AdminApiConfig.oauth2RegisteredClientRestGrantType, content),
]

mockProdServerUtils.addMockList(...mockList)

export const items = content
